/**
 * 
 */
package com.ubo.visu.model;

import com.ubo.visu.painter.association.IAssociationPainter;
import com.ubo.visu.painter.association.IDrawableAssociation;

/**
 * @author saludegu
 * 
 */
public class ModelAssociation implements IDrawableAssociation {

	/**
	 * Node de départ.
	 */
	protected ModelNode mNodeFrom;

	/**
	 * Node de destination.
	 */
	protected ModelNode mNodeTo;

	/**
	 * Type de l'association.
	 */
	protected EModelAssociationType mAssociationType;

	/**
	 * Cardinalité from.
	 */
	protected String mCardFrom;

	/**
	 * Cardinalité to.
	 */
	protected String mCardTo;

	/**
	 * 
	 * Constructor
	 * 
	 * @param nodeFrom
	 * @param nodeTo
	 */
	public ModelAssociation(ModelNode nodeFrom, ModelNode nodeTo,
			EModelAssociationType associationType, String cardFrom,
			String cardTo) {
		mNodeFrom = nodeFrom;
		mNodeTo = nodeTo;
		mAssociationType = associationType;
		mCardFrom = cardFrom;
		mCardTo = cardTo;
	}

	/**
	 * Getter du type d'association.
	 * 
	 * @return
	 */
	public EModelAssociationType getAssociationType() {
		return mAssociationType;
	}

	/**
	 * @see com.ubo.visu.painter.association.IDrawableAssociation#paint(com.ubo.visu.painter.association.IAssociationPainter)
	 */
	@Override
	public void paint(IAssociationPainter painter) {
		painter.paint(this);
	}

	/**
	 * @return the mNodeFrom
	 */
	public ModelNode getNodeFrom() {
		return mNodeFrom;
	}

	/**
	 * @return the mNodeTo
	 */
	public ModelNode getNodeTo() {
		return mNodeTo;
	}

	/**
	 * @return the mCardFrom
	 */
	public String getCardFrom() {
		return mCardFrom;
	}

	/**
	 * @return the mCardTo
	 */
	public String getCardTo() {
		return mCardTo;
	}

}
